package com.xinchao.job.service;

import com.xinchao.job.mapper.dmp.DeviceCityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @ClassName DeviceCityMapService
 * @Description TOOD
 * @Author HanQinrui
 * @Date 2018/9/4 18:41
 * @Version 1.0
 **/
@Service("deviceCityMapService")
public class DeviceCityMapService {
    @Autowired
    private DeviceCityMapper deviceCityMapper;
    /**
     * 通过机器码前两位查询到所属城市对应的编码
     * @param machineNum 机器码前两位
     * @return 天气城市编码
     */
    public String getWeatherCityCodeByDeviceCode(String machineNum) {
        return deviceCityMapper.getWeatherCityCodeByDeviceCode(machineNum);
    }

    /**
     * 获取当前需要抓取天气的城市
     * @return
     */
    public List<HashMap<String, String>> getWeatherCityMap() {
        return deviceCityMapper.getWeatherCityMap();
    }
}
